# constructProj/jsonConfig.py
# -*-coding:utf-8 -*-
# @file       jsonConfig.py
# @author     yearnext
# @version    1.0.0
# @date       2021-11-19
# @brief      constructProj jsonConfig.py component
import os
import sys
import traceback
from PyQt5 import QtCore, QtGui, QtWidgets
from moudles.ui import VisualDataPage
from moudles.tool import tLog


class VisualDataPageWidget(QtWidgets.QWidget, VisualDataPage.uiVisualDataPage):
    def __init__(self, argv, parent=None):
        super().__init__(parent)

        self.filePath = ''
        self.fileData = ''
        self.configData = {}

        self.srcDataList = []
        self.errDataList = []

        # UI初始化
        self.uiInit()

        # 输入参数初始化
        self.inputParamInit(argv)

        # 信号槽初始化
        self.signalSoltInit()

    # UI初始化
    def uiInit(self):
        # UI 初始化
        self.setupUi(self)

        # icon = QtGui.QIcon()
        # icon.addPixmap(QtGui.QPixmap(".\\ico\\data_visual_main_logo.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        # self.setWindowIcon(icon)

        # progName = u'JSON结构可视化工具'
        # verStr   = u'1.0.0'
        # titleStr = str('{0} Ver{1}'.format(progName, verStr))
        # self.setWindowTitle(titleStr)

    # 输入参数初始化
    def inputParamInit(self, argv):
        tLog.putFuncArg(argv)

    def signalSoltInit(self):
        print('signal solt init')

    ####################################################################################################################
    # 外部接口调用
    ####################################################################################################################
    def getToolName(self):
        return u'数据可视化'

    def getToolVersion(self):
        return 100

    def getToolDesc(self):
        return u'数据可视化工具'

    def dataIn(self, data):
        tLog.putInfo(data)

    def dataOut(self, data):
        tLog.putInfo(data)

    def getCallAPI(self):
        return {'name':self.getToolName, \
                'ver':self.getToolVersion, \
                'desc':self.getToolDesc, \
                'data_in':self.dataIn, \
                'data_out':self.dataOut}

# if __name__ == '__main__':
#     app = QtWidgets.QApplication(sys.argv)
#     window = VisualDataPageWidget(sys.argv)
#     window.show()
#     sys.exit(app.exec_())

